<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="./../template/WorkspaceTemplate.xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:c="http://java.sun.com/jsp/jstl/core">

    <ui:define name="top">
        
    </ui:define>

    <ui:define name="left">
        
    </ui:define>

    <ui:define name="right">
        
    </ui:define>

    <ui:define name="content">
        <style>
            .ui-datatable table {
                text-align: center;
                border-collapse: collapse;
                width: 100%;
                border-color: grey;
                background-color: white;
            }
            .ui-datatable table td{
                padding: 7px;
                width: 45px;
            }
            .ui-datatable table th{
                height: 30px;
                width: 30px;
            }
            .ui-datatable .ui-datatable-header, .ui-datatable .ui-datatable-footer {
                text-align: center;
                padding: 4px 10px 4px 160px;
            }
            .ui-inputfield, .ui-widget-content .ui-inputfield, .ui-widget-header .ui-inputfield {
                width: 35px;
            }
        </style>
        <h:form id="dmpsInfoForm">
            <p:panel header="Daily Master Productin Schedule Basic Information">
                <p:messages showDetail="true"/>
                <h:panelGrid columns="4">
                    <h:outputLabel style="font-weight: bold" value="Date Created: "/>
                    <h:outputText value="#{dailyMpsEditManagerBean.editDMPS.formattedDay}"/>
                    <h:outputText value=""/>
                    <h:outputText value=""/>


                </h:panelGrid>
                <p:commandButton value="Save" ajax="false" action="#{dailyMpsEditManagerBean.confirmDMPS()}"/>
                <p:ajaxStatus style="width: 16px;height: 16px;">
                    <f:facet name="start">
                        <h:graphicImage value="./../images/ajaxloading.gif"/>
                    </f:facet>
                    <f:facet name="complete">
                        <h:outputText value=""/>
                    </f:facet>
                </p:ajaxStatus>
            </p:panel>
        </h:form>
        <h:form id="dmpsForm">
            <p:panel header="Operations">
                <p:commandButton value="Calculate" ajax="true" update="dmpsForm,dmpsInfoForm" action="#{dailyMpsEditManagerBean.calculateDMPS()}"/>
                <p:commandButton value="Reset" ajax="true" update="dmpsForm,dmpsInfoForm" action="#{dailyMpsEditManagerBean.resetDMPS()}"/>
                <p:commandButton value="Auto Schedule" ajax="true" update="scheduleForm,dmpsInfoForm" oncomplete="handleScheduleRequest(xhr, status, args)"
                                 actionListener="#{dailyMpsEditManagerBean.scheduleDMPS}"/>
                <p:commandButton value="Manual Schedule" ajax="true" update="scheduleForm2,dmpsInfoForm" oncomplete="handleScheduleRequest2(xhr, status, args)"
                                 actionListener="#{dailyMpsEditManagerBean.scheduleDMPS2}"/>
            </p:panel>
            <div style="border:1px solid gray;width:700px;overflow-y:hidden;overflow-x:scroll;">
                <div class="ui-datatable ui-widget">
                    <table border="1" summary="for all products">
                        <caption>
                            <div class="ui-datatable-header ui-widget-header ui-corner-tl ui-corner-tr">
                                Daily Master Production Schedule
                            </div>
                        </caption>

                        <tbody class="ui-datatable-data">
                            <tr>
                                <th class="ui-state-default" colspan="2" rowspan="5"> Original Monthly Demand</th>
                            </tr>
                            <c:forEach items="#{dailyMpsEditManagerBean.counterForProduct}" var="item">
                                <tr>
                                    <th class="ui-state-default"><h:outputText value="#{dailyMpsEditManagerBean.returnProductAlpha(item)}" /></th>
                                    <td colspan="10"><h:outputText value="#{dailyMpsEditManagerBean.monthlyDemands.get(item)}"/></td>
                                </tr>
                            </c:forEach>

                            <tr>
                                <th class="ui-state-default" colspan="2">Working Days</th>
                                <th class="ui-state-default"></th>
                                <td colspan="10"><h:outputText value="#{dailyMpsEditManagerBean.totalWorkingDays}"/></td>
                            </tr>

                            <tr>
                                <th class="ui-state-default" colspan="2">Daily MPS</th>
                                <th class="ui-state-default"></th>
                                <c:forEach items="#{dailyMpsEditManagerBean.times}" var="item">
                                    <td colspan="2"><h:outputText value="#{dailyMpsEditManagerBean.returnFormattedDay(item)}"/></td>
                                </c:forEach>
                            </tr>

                            <tr>
                                <th class="ui-state-default" colspan="2"></th>
                                <th class="ui-state-default"></th>
                                <c:forEach items="#{dailyMpsEditManagerBean.counterForWeek}" var="item">
                                    <td colspan="2">Total</td>
                                </c:forEach>
                            </tr>

                            <tr>
                                <th class="ui-state-default" colspan="2"></th>
                                <th class="ui-state-default"></th>
                                <c:forEach items="#{dailyMpsEditManagerBean.counterForWeek}" var="item">
                                    <td>Cases</td>
                                    <td>hrs</td>
                                </c:forEach>
                            </tr>


                            <tr>
                                <th class="ui-state-default" colspan="2" rowspan="5">Daily Demand(Normal)</th>
                            </tr>
                            <c:forEach items="#{dailyMpsEditManagerBean.counterForProduct}" var="item">
                                <tr>
                                    <th class="ui-state-default"><h:outputText value="#{dailyMpsEditManagerBean.returnProductAlpha(item)}" /></th>
                                    <c:forEach items="#{dailyMpsEditManagerBean.counterForWeek}" var="counter">
                                        <td><p:inputText value="#{dailyMpsEditManagerBean.dailyDemandsInput.get(item).get(counter).l}" 
                                                         required="true" requiredMessage="Please input daily demand for normal shift."
                                                         rendered="#{dailyMpsEditManagerBean.renderEdit(counter)}"/>
                                            <h:outputText value="#{dailyMpsEditManagerBean.dailyDemandsInput.get(item).get(counter).l}" 
                                                          rendered="#{!dailyMpsEditManagerBean.renderEdit(counter)}"/>
                                        </td>
                                        <td><h:outputText value="#{dailyMpsEditManagerBean.returnDailyDemandInHours(dailyMpsEditManagerBean.dailyDemandsInput.get(item).get(counter).l, item)}">
                                                <f:convertNumber pattern="#.##"/>
                                            </h:outputText></td>
                                    </c:forEach>
                                </tr>
                            </c:forEach>

                            <tr>
                                <th class="ui-state-default" colspan="2">Capacity with Normal Shift</th>
                                <th class="ui-state-default"></th>
                                <c:forEach items="#{dailyMpsEditManagerBean.counterForWeek}" var="counter">
                                    <th></th>
                                    <td><h:outputText value="#{dailyMpsEditManagerBean.returnNormalShift()}"/></td>
                                </c:forEach>
                            </tr>

                            <tr>
                                <th class="ui-state-default" colspan="2">Utilization with Normal Shift</th>
                                <th class="ui-state-default"></th>
                                <c:forEach items="#{weeklyMpsManagerBean.counterForWeek}" var="counter">
                                    <th></th>
                                    <td><h:outputText value="#{dailyMpsEditManagerBean.returnUtilizationNormalShift(counter)}">
                                            <f:convertNumber type="percent" />
                                        </h:outputText></td>
                                </c:forEach>
                            </tr>

                            <tr>
                                <th class="ui-state-default" colspan="2" rowspan="5">Daily Demand(Overtime)</th>
                            </tr>
                            <c:forEach items="#{dailyMpsEditManagerBean.counterForProduct}" var="item">
                                <tr>
                                    <th class="ui-state-default"><h:outputText value="#{dailyMpsEditManagerBean.returnProductAlpha(item)}" /></th>
                                    <c:forEach items="#{dailyMpsEditManagerBean.counterForWeek}" var="counter">
                                        <td><p:inputText value="#{dailyMpsEditManagerBean.dailyOTDemandsInput.get(item).get(counter).l}" 
                                                         required="true" requiredMessage="Please input daily demand for overtime shift."
                                                         rendered="#{dailyMpsEditManagerBean.renderEdit(counter)}"/>
                                            <h:outputText value="#{dailyMpsEditManagerBean.dailyOTDemandsInput.get(item).get(counter).l}" 
                                                          rendered="#{!dailyMpsEditManagerBean.renderEdit(counter)}"/>
                                        </td>
                                        <td><h:outputText value="#{dailyMpsEditManagerBean.returnDailyDemandInHours(dailyMpsEditManagerBean.dailyOTDemandsInput.get(item).get(counter).l, item)}">
                                                <f:convertNumber pattern="#.##"/>
                                            </h:outputText></td>
                                    </c:forEach>
                                </tr>
                            </c:forEach>

                            <tr>
                                <th class="ui-state-default" colspan="2">Capacity with Overtime Shift</th>
                                <th class="ui-state-default"></th>
                                <c:forEach items="#{dailyMpsEditManagerBean.counterForWeek}" var="counter">
                                    <th></th>
                                    <td><h:outputText value="#{dailyMpsEditManagerBean.returnOvertimeShift()}"/></td>
                                </c:forEach>
                            </tr>

                            <tr>
                                <th class="ui-state-default" colspan="2">Utilization with Overtime Shift</th>
                                <th class="ui-state-default"></th>
                                <c:forEach items="#{weeklyMpsManagerBean.counterForWeek}" var="counter">
                                    <th></th>
                                    <td><h:outputText value="#{dailyMpsEditManagerBean.returnUtilizationOvertimeShift(counter)}">
                                            <f:convertNumber type="percent" />
                                        </h:outputText></td>
                                </c:forEach>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </h:form>
        <h:form id="legend">
            <p:panel>
                <h:panelGrid columns ="8">
                    <c:forEach items="#{dailyMpsEditManagerBean.counterForProduct}" var="item">
                        <h:outputText value="#{dailyMpsEditManagerBean.returnProductAlpha(item)}" />
                        <h:outputText value="#{dailyMpsEditManagerBean.returnProductName(item)}"/>
                        <h:outputLabel value=""/>
                        <h:outputLabel value=""/>
                    </c:forEach>
                </h:panelGrid>
            </p:panel>
        </h:form>
        <p:dialog id="scheduleDialog" widgetVar="scheduleDlg" header="View computer-generated schedule" showEffect="explode" hideEffect="explode" width="850">
            <h:form id="scheduleForm">
                <h:outputLink id="lnk" value="#" style="right: 250px">  
                    <p:printer target="scheduleForm" />  
                    <p:graphicImage value="/images/print.png" height="45px" width="45px"/>  
                </h:outputLink>
                <div class="ui-datatable ui-widget">
                    <table border="1" summary="for all products">
                        <caption>
                            <div class="ui-datatable-header ui-widget-header ui-corner-tl ui-corner-tr">
                                Auto Scheduling Table
                            </div>
                        </caption>

                        <tbody class="ui-datatable-data">
                            <tr>
                                <th class="ui-state-default" colspan="2">Working Days</th>
                                <th class="ui-state-default"></th>
                                <td colspan="10"><h:outputText value="#{dailyMpsEditManagerBean.totalWorkingDays}"/></td>
                            </tr>

                            <tr>
                                <th class="ui-state-default" colspan="2">Daily MPS</th>
                                <th class="ui-state-default"></th>
                                <c:forEach items="#{dailyMpsEditManagerBean.times}" var="item">
                                    <td colspan="2"><h:outputText value="#{dailyMpsEditManagerBean.returnFormattedDay(item)}"/></td>
                                </c:forEach>
                            </tr>

                            <tr>
                                <th class="ui-state-default" colspan="2"></th>
                                <th class="ui-state-default"></th>
                                <c:forEach items="#{dailyMpsEditManagerBean.counterForWeek}" var="item">
                                    <td>Line1(hr)</td>
                                    <td>Line2(hr)</td>
                                </c:forEach>
                            </tr>

                            <tr>
                                <th class="ui-state-default" colspan="2" rowspan="5">Daily Demand(Normal)</th>
                            </tr>
                            <c:forEach items="#{dailyMpsEditManagerBean.counterForProduct}" var="item">
                                <tr>
                                    <th class="ui-state-default"><h:outputText value="#{dailyMpsEditManagerBean.returnProductAlpha(item)}" /></th>
                                    <c:forEach items="#{dailyMpsEditManagerBean.counterForWeek}" var="counter">
                                        <td><h:outputText value="#{dailyMpsEditManagerBean.scheduleResult.scheduledNormalResults.get(counter).get(item).get(0)}" >
                                                <f:convertNumber pattern="#.##"/>
                                            </h:outputText></td>
                                        <td><h:outputText value="#{dailyMpsEditManagerBean.scheduleResult.scheduledNormalResults.get(counter).get(item).get(1)}">
                                                <f:convertNumber pattern="#.##"/>
                                            </h:outputText></td>
                                    </c:forEach>
                                </tr>
                            </c:forEach>

                            <tr>
                                <th class="ui-state-default" colspan="2">Capacity with Normal Shift</th>
                                <th class="ui-state-default"></th>
                                <c:forEach items="#{dailyMpsEditManagerBean.counterForWeek}" var="counter">
                                    <td><h:outputText value="#{dailyMpsEditManagerBean.scheduleResult.normalScheduledCapacities.get(counter).get(0)}">
                                            <f:convertNumber pattern="#.##"/>
                                        </h:outputText></td>
                                    <td><h:outputText value="#{dailyMpsEditManagerBean.scheduleResult.normalScheduledCapacities.get(counter).get(1)}">
                                            <f:convertNumber pattern="#.##"/>
                                        </h:outputText></td>
                                </c:forEach>
                            </tr>

                            <tr>
                                <th class="ui-state-default" colspan="2">Utilization with Normal Shift</th>
                                <th class="ui-state-default"></th>
                                <c:forEach items="#{weeklyMpsManagerBean.counterForWeek}" var="counter">
                                    <td><h:outputText value="#{dailyMpsEditManagerBean.scheduleResult.normalScheduledUtilization.get(counter).get(0)}">
                                            <f:convertNumber type="percent" />
                                        </h:outputText></td>
                                    <td><h:outputText value="#{dailyMpsEditManagerBean.scheduleResult.normalScheduledUtilization.get(counter).get(1)}">
                                            <f:convertNumber type="percent" />
                                        </h:outputText></td>
                                </c:forEach>
                            </tr>

                            <tr>
                                <th class="ui-state-default" colspan="2" rowspan="5">Daily Demand(Overtime)</th>
                            </tr>
                            <c:forEach items="#{dailyMpsEditManagerBean.counterForProduct}" var="item">
                                <tr>
                                    <th class="ui-state-default"><h:outputText value="#{dailyMpsEditManagerBean.returnProductAlpha(item)}" /></th>
                                    <c:forEach items="#{dailyMpsEditManagerBean.counterForWeek}" var="counter">
                                        <td><h:outputText value="#{dailyMpsEditManagerBean.scheduleResult.scheduledOvertimeResults.get(counter).get(item).get(0)}" >
                                                <f:convertNumber pattern="#.##"/>
                                            </h:outputText></td>
                                        <td><h:outputText value="#{dailyMpsEditManagerBean.scheduleResult.scheduledOvertimeResults.get(counter).get(item).get(1)}">
                                                <f:convertNumber pattern="#.##"/>
                                            </h:outputText></td>
                                    </c:forEach>
                                </tr>
                            </c:forEach>

                            <tr>
                                <th class="ui-state-default" colspan="2">Capacity with Overtime Shift</th>
                                <th class="ui-state-default"></th>
                                <c:forEach items="#{dailyMpsEditManagerBean.counterForWeek}" var="counter">
                                    <td><h:outputText value="#{dailyMpsEditManagerBean.scheduleResult.overtimeScheduledCapacities.get(counter).get(0)}">
                                            <f:convertNumber pattern="#.##"/>
                                        </h:outputText></td>
                                    <td><h:outputText value="#{dailyMpsEditManagerBean.scheduleResult.overtimeScheduledCapacities.get(counter).get(1)}">
                                            <f:convertNumber pattern="#.##"/>
                                        </h:outputText></td>
                                </c:forEach>
                            </tr>

                            <tr>
                                <th class="ui-state-default" colspan="2">Utilization with Overtime Shift</th>
                                <th class="ui-state-default"></th>
                                <c:forEach items="#{weeklyMpsManagerBean.counterForWeek}" var="counter">
                                    <td><h:outputText value="#{dailyMpsEditManagerBean.scheduleResult.overtimeScheduledUtilization.get(counter).get(0)}">
                                            <f:convertNumber type="percent" />
                                        </h:outputText></td>
                                    <td><h:outputText value="#{dailyMpsEditManagerBean.scheduleResult.overtimeScheduledUtilization.get(counter).get(1)}">
                                            <f:convertNumber type="percent" />
                                        </h:outputText></td>
                                </c:forEach>
                            </tr>
                        </tbody>
                    </table>
                </div>
                <p:commandButton value="OK" ajax="true" onclick="scheduleDlg.hide()"/>
            </h:form>
        </p:dialog>
        
        <p:dialog id="scheduleDialog2" widgetVar="scheduleDlg2" header="Manual schedule" showEffect="explode" hideEffect="explode" width="850">
            <h:form id="scheduleForm2">
                <h:outputLink id="lnk2" value="#" style="right: 250px">  
                    <p:printer target="scheduleForm2" />  
                    <p:graphicImage value="/images/print.png" height="45px" width="45px"/>  
                </h:outputLink>
                <p:messages showDetail="true"/>
                <p:commandButton value="Check Capacity of Scheduled Result" update="scheduleForm2" 
                                 actionListener="#{dailyMpsEditManagerBean.checkScheduleCapacity}"/>
                <div class="ui-datatable ui-widget">
                    <table border="1" summary="for all products">
                        <caption>
                            <div class="ui-datatable-header ui-widget-header ui-corner-tl ui-corner-tr">
                                Manual Scheduling Table
                            </div>
                        </caption>

                        <tbody class="ui-datatable-data">
                            <tr>
                                <th class="ui-state-default" colspan="2">Working Days</th>
                                <th class="ui-state-default"></th>
                                <td colspan="10"><h:outputText value="#{dailyMpsEditManagerBean.totalWorkingDays}"/></td>
                            </tr>

                            <tr>
                                <th class="ui-state-default" colspan="2">Daily MPS</th>
                                <th class="ui-state-default"></th>
                                <c:forEach items="#{dailyMpsEditManagerBean.times}" var="item">
                                    <td colspan="2"><h:outputText value="#{dailyMpsEditManagerBean.returnFormattedDay(item)}"/></td>
                                </c:forEach>
                            </tr>

                            <tr>
                                <th class="ui-state-default" colspan="2"></th>
                                <th class="ui-state-default"></th>
                                <c:forEach items="#{dailyMpsEditManagerBean.counterForWeek}" var="item">
                                    <td>Line1(hr)</td>
                                    <td>Line2(hr)</td>
                                </c:forEach>
                            </tr>

                            <tr>
                                <th class="ui-state-default" colspan="2" rowspan="5">Daily Demand(Normal)</th>
                            </tr>
                            <c:forEach items="#{dailyMpsEditManagerBean.counterForProduct}" var="item">
                                <tr>
                                    <th class="ui-state-default"><h:outputText value="#{dailyMpsEditManagerBean.returnProductAlpha(item)}" /></th>
                                    <c:forEach items="#{dailyMpsEditManagerBean.counterForWeek}" var="counter">
                                        <td><p:inputText value="#{dailyMpsEditManagerBean.scheduledNormalResults.get(counter).get(item).get(0).d}"
                                                         required="true" requiredMessage="Please input all the fields"
                                                         rendered="#{dailyMpsEditManagerBean.renderEdit(counter)}"/>
                                            <h:outputText value="#{dailyMpsEditManagerBean.scheduledNormalResults.get(counter).get(item).get(0).d}"
                                                          rendered="#{!dailyMpsEditManagerBean.renderEdit(counter)}">
                                                <f:convertNumber pattern="#.##"/>
                                            </h:outputText>
                                        </td>
                                        <td><p:inputText value="#{dailyMpsEditManagerBean.scheduledNormalResults.get(counter).get(item).get(1).d}"
                                                          required="true" requiredMessage="Please input all the fields"
                                                          rendered="#{dailyMpsEditManagerBean.renderEdit(counter)}"/>
                                            <h:outputText value="#{dailyMpsEditManagerBean.scheduledNormalResults.get(counter).get(item).get(1).d}"
                                                          rendered="#{!dailyMpsEditManagerBean.renderEdit(counter)}">
                                                <f:convertNumber pattern="#.##"/>
                                            </h:outputText>
                                        </td>
                                    </c:forEach>
                                </tr>
                            </c:forEach>

                            <tr>
                                <th class="ui-state-default" colspan="2">Capacity with Normal Shift</th>
                                <th class="ui-state-default"></th>
                                <c:forEach items="#{dailyMpsEditManagerBean.counterForWeek}" var="counter">
                                    <td><h:outputText value="#{dailyMpsEditManagerBean.normalScheduledCapacities.get(counter).get(0).d}">
                                            <f:convertNumber pattern="#.##"/>
                                        </h:outputText></td>
                                    <td><h:outputText value="#{dailyMpsEditManagerBean.normalScheduledCapacities.get(counter).get(1).d}">
                                            <f:convertNumber pattern="#.##"/>
                                        </h:outputText></td>
                                </c:forEach>
                            </tr>

                            <tr>
                                <th class="ui-state-default" colspan="2">Utilization with Normal Shift</th>
                                <th class="ui-state-default"></th>
                                <c:forEach items="#{weeklyMpsManagerBean.counterForWeek}" var="counter">
                                    <td><h:outputText value="#{dailyMpsEditManagerBean.normalScheduledUtilization.get(counter).get(0).d}">
                                            <f:convertNumber type="percent" />
                                        </h:outputText></td>
                                    <td><h:outputText value="#{dailyMpsEditManagerBean.normalScheduledUtilization.get(counter).get(1).d}">
                                            <f:convertNumber type="percent" />
                                        </h:outputText></td>
                                </c:forEach>
                            </tr>

                            <tr>
                                <th class="ui-state-default" colspan="2" rowspan="5">Daily Demand(Overtime)</th>
                            </tr>
                            <c:forEach items="#{dailyMpsEditManagerBean.counterForProduct}" var="item">
                                <tr>
                                    <th class="ui-state-default"><h:outputText value="#{dailyMpsEditManagerBean.returnProductAlpha(item)}" /></th>
                                    <c:forEach items="#{dailyMpsEditManagerBean.counterForWeek}" var="counter">
                                        <td><p:inputText value="#{dailyMpsEditManagerBean.scheduledOvertimeResults.get(counter).get(item).get(0).d}" 
                                                          required="true" requiredMessage="Please input all the fields"
                                                          rendered="#{dailyMpsEditManagerBean.renderEdit(counter)}"/>
                                            <h:outputText value="#{dailyMpsEditManagerBean.scheduledOvertimeResults.get(counter).get(item).get(0).d}"
                                                          rendered="#{!dailyMpsEditManagerBean.renderEdit(counter)}">
                                                <f:convertNumber pattern="#.##"/>
                                            </h:outputText>
                                        </td>
                                        <td><p:inputText value="#{dailyMpsEditManagerBean.scheduledOvertimeResults.get(counter).get(item).get(1).d}"
                                                          required="true" requiredMessage="Please input all the fields"
                                                          rendered="#{dailyMpsEditManagerBean.renderEdit(counter)}"/>
                                            <h:outputText value="#{dailyMpsEditManagerBean.scheduledOvertimeResults.get(counter).get(item).get(1).d}"
                                                          rendered="#{!dailyMpsEditManagerBean.renderEdit(counter)}">
                                                <f:convertNumber pattern="#.##"/>
                                            </h:outputText>
                                        </td>
                                    </c:forEach>
                                </tr>
                            </c:forEach>

                            <tr>
                                <th class="ui-state-default" colspan="2">Capacity with Overtime Shift</th>
                                <th class="ui-state-default"></th>
                                <c:forEach items="#{dailyMpsEditManagerBean.counterForWeek}" var="counter">
                                    <td><h:outputText value="#{dailyMpsEditManagerBean.overtimeScheduledCapacities.get(counter).get(0).d}">
                                            <f:convertNumber pattern="#.##"/>
                                        </h:outputText></td>
                                    <td><h:outputText value="#{dailyMpsEditManagerBean.overtimeScheduledCapacities.get(counter).get(1).d}">
                                            <f:convertNumber pattern="#.##"/>
                                        </h:outputText></td>
                                </c:forEach>
                            </tr>

                            <tr>
                                <th class="ui-state-default" colspan="2">Utilization with Overtime Shift</th>
                                <th class="ui-state-default"></th>
                                <c:forEach items="#{weeklyMpsManagerBean.counterForWeek}" var="counter">
                                    <td><h:outputText value="#{dailyMpsEditManagerBean.overtimeScheduledUtilization.get(counter).get(0).d}">
                                            <f:convertNumber type="percent" />
                                        </h:outputText></td>
                                    <td><h:outputText value="#{dailyMpsEditManagerBean.overtimeScheduledUtilization.get(counter).get(1).d}">
                                            <f:convertNumber type="percent" />
                                        </h:outputText></td>
                                </c:forEach>
                            </tr>
                        </tbody>
                    </table>
                </div>
                <p:commandButton value="OK" ajax="true" onclick="scheduleDlg2.hide()"/>
            </h:form>
        </p:dialog>
        <script type="text/javascript">
            function handleScheduleRequest(xhr, status, args) {  
                if(args.validationFailed || !args.isValid) {  
                    alert("Please make sure your utilization is less than 90%.");
                } else {  
                    scheduleDlg.show();
                }  
            }  
            function handleScheduleRequest2(xhr, status, args) {  
                if(args.validationFailed || !args.isValid) {  
                    alert("Please make sure your utilization is less than 90%.");
                } else {  
                    scheduleDlg2.show();
                }  
            }  
        </script>
    </ui:define>

    <ui:define name="bottom">
        
    </ui:define>

</ui:composition>
